package com.sdj.quick.web.controller;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.sdj.quick.web.dto.SendComsumeSmsDto;

/***
 * 快捷支付短信测试
 * @author Administrator
 *
 */

@Controller
@RequestMapping("/sms")
public class ComsumeSMSController extends BaseController{
	

	@RequestMapping("/toComsumeSMS")
	public String toOpenSMS(){
		return "comsumeSms";
	}
	
	@RequestMapping(value="/sendComsumeSMS",method=RequestMethod.POST)
	public @ResponseBody String sendComsumeSMS(SendComsumeSmsDto sendComsumeSmsDto){
		logger.info("快捷消费短信发送请求参数对象:【{}】",sendComsumeSmsDto);
		String merKey = sendComsumeSmsDto.getMerKey();
		String path = quickConfig.getComsumeSMSUrl();
		sendComsumeSmsDto.setOrderNo(getOrderNo("400"));
		Map<String,String> map = getPostResult(path,merKey,sendComsumeSmsDto);
		return JSON.toJSONString(map);
	}

}
